/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.card.service;

import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.asset.dto.AssetCardCreateDTO;
import com.fuyao.cloud.asset.dto.AssetCardEditDTO;
import com.fuyao.cloud.asset.entity.AssetCard;
import com.fuyao.cloud.asset.entity.ac.AssetAc;
import com.fuyao.cloud.asset.vo.card.AssetCardDTO;
import com.fuyao.cloud.asset.vo.card.AssetCardImportVO;
import com.fuyao.cloud.common.core.util.R;
import org.springframework.validation.BindingResult;

import java.util.List;

/**
 * 资产信息管理
 *
 * @author liyue
 * @date 2021-11-18 18:44:56
 */
public interface AssetAssetcardService extends IService<AssetCard> {

	/**
	 * 查询资产信息树
	 *
	 * @param query 查询构造器
	 * @return 资产信息树
	 */
	List<Tree<Long>> selectTree(QueryWrapper<AssetCard> query);

	/**
	 * 查询资产信息集合
	 *
	 * @param query 查询构造器
	 * @return 资产信息集合
	 */
	List listAssetCard(QueryWrapper<AssetCard> query);

	/**
	 * 导入资产信息方法
	 *
	 * @param excelList     导入列表
	 * @param bindingResult 绑定对象
	 * @return 导入信息
	 */
	R importAssetCard(List<AssetCardImportVO> excelList, BindingResult bindingResult);

	/**
	 * 资产信息创建方法
	 *
	 * @return 资产信息对象
	 */
	AssetCardCreateDTO create();

	/**
	 * 产品分页方法
	 *
	 * @param page  分页对象
	 * @param query 查询query
	 * @return 分页对象
	 */
	IPage<AssetCardDTO> getAssetCardPage(Page page, QueryWrapper<AssetCard> query);

	/**
	 * 根据资产id修改状态
	 * @param ids 资产 ids
	 * @param status 状态
	 * @return 是否修改成功
	 */
	boolean updateStatus(List<Long> ids, String status);

	/**
	 *  通过验收单生成资产信息
	 * @param assetAc 验收对象
	 * @return 返回生成的资产信息
	 */
	List<AssetCard> generateByAssetCardList(AssetAc assetAc);

	/**
	 * 批量删除
	 * @param ids 资产ID集合
	 * @return R
	 */
	R batchDelete(List<Long> ids);

	/**
	 * 资产编辑方法
	 * @param id 资产ID
	 * @return R
	 */
	AssetCardEditDTO edit(Long id);
}
